<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
    <title>碧叶之源</title>
<#--<meta name="keywords" content="关键词,5个左右,单个8汉字以内">-->
    <meta name="keywords" content="机构部门新增"/>
<#--<meta name="description" content="网站描述，字数尽量空制在80个汉字，160个字符以内！">-->
    <meta name="description" content="欢迎进入碧叶之源！"/>


<#--妹子UI-->
    <link type="text/css" rel="stylesheet" href="/plugin/amaze/css/amazeui.min.css"/>
    <link type="text/css" rel="stylesheet" href="/plugin/amaze/css/amazeui.datatables.min.css"/>
    <link type="text/css" rel="stylesheet" href="/plugin/amaze/css/app.css">

<#--自己的样式-->
    <link type="text/css" rel="stylesheet" href="/css/ztree/main.css">
    <style type="text/css">

    </style>

</head>


<body>


<body data-type="widgets">

<div class="am-g tpl-g">


    <div class="row-content am-cf">


        <div class="row">

            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title am-fl">机构|岗位新增</div>
                        <div class="widget-function am-fr">
                            <a href="javascript:;" class="am-icon-cog"></a>
                        </div>
                    </div>
                    <div class="widget-body am-fr">

                        <form class="am-form tpl-form-border-form tpl-form-border-br" id="formOraganization">
                            <#--当新增的时候，前端传递过来的id是父级的id-->
                            <input id="fatherorgNode" name="fatherorgNode" type="hidden" value="${fatherorgNode!''}"/>
                            <input id="fatherorgName" name="fatherorgName" type="hidden" value="${fatherorgName!''}"/>
                                <#--更新还是新增标识-->
                            <input id="operateType" name="operateType" type="hidden" value="${operateType!''}"/>
                            <input id="id" name="id" type="hidden" value="${organizationEdit.id!''}"/>
                                <#--如果是增加父机构的时候，则需要这个数据，来保存原来的节点ID-->
                            <input id="sonId" name="sonId" type="hidden" value="${sonId!''}"/>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构名称</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" id="name" name="name" value="${organizationEdit.name!''}" placeholder="请输入机构名称">
                                    <small><span class="required"> * </span>请填写该机构|部门的名称。比如公安部、环境保护部等
                                    </small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">管辖机构</label>
                                <div class="am-u-sm-9">
                                    <input type="text" disabled value="${nameStr!''}">
                                    <small><span class="required"> * </span>管辖机构就是隶属的父机构</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构图标</label>
                                <div class="am-u-sm-9">
                                    <div id="containerImg" style="width: 75px;height: 75px;">
                                        <#--//图片预览容器-->
                                        <#if (organizationEdit.img!'')?? && ((organizationEdit.img!'') != "") >
                                            <img src="/main/getOrgImgHred?id=${organizationEdit.img!''}" >
                                            <input id="img" name="img" type="hidden" value="${organizationEdit.img!''}"/>
                                        <#else >
                                            <img src="/img/common/nationalEmblem.png" style="width:75px;height:75px;">
                                        </#if>
                                    </div>
                                    <input type="file" class="tpl-form-input" id="imgFile" onchange="imgContainerView()" name="imgFile" placeholder="请输入机构图标">
                                    <small>机构图标是该机构或部门的徽章标识，非必须。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构简称</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.simpName!''}" id="simpName" name="simpName" placeholder="请输入机构简称">
                                    <small>请填写该机构|部门的机构简称，非必填</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">英文名</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.enName!''}" id="enName" name="enName" placeholder="请输入英文名">
                                    <small>请填写该机构|部门的英文名，非必填</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">英文简称</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.enSimpName!''}" id="enSimpName" name="enSimpName" placeholder="请输入英文简称">
                                    <small>请填写该机构|部门的英文简称，非必填</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">是否根机构</label>
                                <div class="am-u-sm-9">
                                    <input onclick="isOrNoRootNode(1)" type="radio" <#if ((organizationEdit.isRoot!'') == '1')>checked </#if> id="isRoot1" name="isRoot" value="1"> 是
                                    <input onclick="isOrNoRootNode(2)" type="radio" <#if ((organizationEdit.isRoot!'') == '2')>checked </#if> id="isRoot2" name="isRoot" value="2" checked="checked"> 否
                                    <hr/>
                                    <small><span class="required"> * </span>注意：根机构指一个机构的最终管理者，比如省工商局最终的根机构隶属工商总局，默认为否，必选。
                                    </small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name"
                                       class="am-u-sm-3 am-form-label">是机构还是部门</label>
                                <div class="am-u-sm-9">
                                    <input type="radio" <#if ((organizationEdit.isDepOrOrg!'') == '1')>checked </#if> id="isDepOrOrg1" name="isDepOrOrg" value="1"> 是机构
                                    <input type="radio" <#if ((organizationEdit.isDepOrOrg!'') == '2')>checked </#if> id="isDepOrOrg2" name="isDepOrOrg" value="2"> 是部门
                                    <hr/>
                                    <small><span class="required"> * </span>注意：是机构还是部门指机构如工商、纪检、公安属于不同的机构，而工商内部的注册科、企管科则属于部门。必选。
                                    </small>
                                </div>
                            </div>

                            <div class="am-form-group" id="fatherNodeDiv">
                                <label for="user-name" class="am-u-sm-3 am-form-label">隶属机构</label>
                                <div class="am-u-sm-9">
                                    <select onclick="getAllRootNode(this, &quot;<option class=\selectOpenStyle\ value=\-1\>请选择隶属机构</option>&quot;, &quot;fatherNode&quot;)" id="fatherNode" name="fatherNode">

                                        <#if ((organizationEdit.fatherNode!'')??) && ((organizationEdit.fatherNode!'') == '')>
                                            <option class="selectOpenStyle" value="-1">请选择隶属机构</option>
                                        <#else >
                                            <option class="selectOpenStyle" value="${organizationEdit.fatherNode!''}">${fatherNode!''}</option>
                                        </#if>
                                    </select>
                                    <small>
                                        隶属机构指该机构的根机构，比如市公安局以及公安局内部财务科都隶属于公安部，适用于双重领导的机构，根机构不需要填写该项。
                                    </small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">部门类型</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.orgDep!''}" id="orgDep" name="orgDep" placeholder="请输入部门类型">
                                    <small>部门类型指的是部门属性。是自定义的部门类型，比如司法部门、行政部门、安全部门，方便后续对机构的归类</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name"
                                       class="am-u-sm-3 am-form-label">是否核心机构</label>
                                <div class="am-u-sm-9">
                                    <input type="radio" <#if ((organizationEdit.coreNode!'') == '1')>checked </#if> id="coreNode1" name="coreNode" value="1"> 是
                                    <input type="radio" <#if ((organizationEdit.coreNode!'') == '2')>checked </#if> id="coreNode2" name="coreNode" value="2" checked="checked"> 否
                                    <hr/>
                                    <small>核心机构指整个系统中最重要的组成部分，非必填。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name"
                                       class="am-u-sm-3 am-form-label">是否保密机构|部门</label>
                                <div class="am-u-sm-9">
                                    <input type="radio" <#if ((organizationEdit.isSecret!'') == '1')>checked </#if> onclick="isSercret()" id="isSecret1" name="isSecret" value="1"> 是
                                    <input type="radio" <#if ((organizationEdit.isSecret!'') == '2')>checked </#if> onclick="isNoSercret()" id="isSecret2" name="isSecret" value="2" checked="checked"> 否
                                    <hr/>
                                    <small>保密机构|部门与权限有关系。默认非保密机构|部门</small>
                                </div>
                            </div>

                            <div class="am-form-group" id="secretGradeDiv">
                                <label for="user-name" class="am-u-sm-3 am-form-label">保密等级</label>
                                <div class="am-u-sm-9">
                                    <select id="secretGrade" onclick="getMovingData(this, &quot;<option class=\selectOpenStyle\ value=\-1\>请选择保密等级</option>&quot;, &quot;8&quot;, &quot;secretGrade&quot;)" name="secretGrade">

                                        <#if ((organizationEdit.secretGrade!'')??) && ((organizationEdit.secretGrade!'') == '')>
                                            <option class="selectOpenStyle" value="-1">请选择保密等级</option>
                                        <#else >
                                            <option class="selectOpenStyle" value="${organizationEdit.secretGrade!''}">${baseInfoSecretGrade!''}</option>
                                        </#if>

                                    </select>
                                    <small>保密等级与访问授权有关系，默认是非保密。</small>
                                </div>
                            </div>

                            <div class="am-form-group" id="isAuthorizeDiv">
                                <label for="user-name" class="am-u-sm-3 am-form-label">是否需要授权才能访问</label>
                                <div class="am-u-sm-9">
                                    <input type="radio" <#if ((organizationEdit.isAuthorize!'') == '1')>checked </#if> onclick="isIsAuthorize()" id="isAuthorize1" name="isAuthorize" value="1"> 是
                                    <input type="radio" <#if ((organizationEdit.isAuthorize!'') == '2')>checked </#if> onclick="isNoisAuthorize()" id="isAuthorize2" name="isAuthorize" value="2"> 否
                                    <hr/>
                                    <small>
                                        该授权指拥有相关机密访问权限，非本机构|部门的人是否可以访问，即内部拥有访问权限可以访问，外部机构不可跨机构访问。
                                    </small>
                                </div>
                            </div>

                            <div class="am-form-group" id="callGradeDiv">
                                <label for="user-name" class="am-u-sm-3 am-form-label">授权等级</label>
                                <div class="am-u-sm-9">
                                    <select id="callGrade" name="callGrade">
                                        <option <#if ((organizationEdit.callGrade!'') == '-1')>selected="selected" </#if> class="selectOpenStyle" value="-1">请选择授权等级</option>
                                        <option <#if ((organizationEdit.callGrade!'') == '1')>selected="selected" </#if> class="selectOpenStyle" value="1">只有领导岗位可以访问</option>
                                        <option <#if ((organizationEdit.callGrade!'') == '2')>selected="selected" </#if> class="selectOpenStyle" value="2">只有本机构特定权限的才能访问</option>
                                        <option <#if ((organizationEdit.callGrade!'') == '3')>selected="selected" </#if> class="selectOpenStyle" value="3">本机构的都可以访问</option>
                                        <option <#if ((organizationEdit.callGrade!'') == '4')>selected="selected" </#if> class="selectOpenStyle" value="4">只有上级领导权限的可以访问</option>
                                        <option <#if ((organizationEdit.callGrade!'') == '5')>selected="selected" </#if> class="selectOpenStyle" value="5">只有特定权限才能访问</option>
                                    </select>
                                    <small>对授权访问的细分，比如保密局内部财务科不能访问相关内部机密部门。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构|部门成立时间</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="am-form-field tpl-form-no-bg" value="${(organizationEdit.createDate?string('yyyy-MM-dd'))!''}"  id="createDate" name="createDate" placeholder="请填写机构成立时间">
                                    <small>机构|部门创立成立时间，根机构、部门才需要填写。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构|部门职责</label>
                                <div class="am-u-sm-9">
                                        <textarea rows="3" class="tpl-form-input" cols="20" id="responsibility" name="responsibility" placeholder="请填写机构职责">${organizationEdit.responsibility!''}</textarea>
                                    <small><span class="required"> * </span>机构|部门的职责、任务，根机构|部门必填。
                                    </small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构|部门邮编</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.zipCode!''}" id="zipCode" name="zipCode" placeholder="请填写机构邮编">
                                    <small>机构|部门的联系邮编。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构|部门地址</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.address!''}" id="address" name="address" placeholder="请填写机构地址">
                                    <small>机构|部门的联系地址。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构|部门电话</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.phone!''}" id="phone" name="phone" placeholder="请填写机构|部门电话">
                                    <small>机构|部门的联系电话。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">机构类型</label>
                                <div class="am-u-sm-9">
                                    <select onclick="getMovingData(this, &quot;<option class=\selectOpenStyle\ value=\-1\>请选择机构类型</option>&quot;, &quot;4&quot;, &quot;orgType&quot;)" id="orgType" name="orgType">

                                        <#if ((organizationEdit.orgType!'')??) && ((organizationEdit.orgType!'') == '')>
                                            <option class="selectOpenStyle" value="-1">请选择机构类型</option>
                                        <#else >
                                            <option class="selectOpenStyle" value="${organizationEdit.orgType!''}">${baseInfoOrgType!''}</option>
                                        </#if>

                                    </select>
                                    <small>机构|部门的机构类型。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">行政级别</label>
                                <div class="am-u-sm-9">
                                    <select id="levelAdministrative" name="levelAdministrative" onclick="getMovingData(this, &quot;<option class=\selectOpenStyle\ value=\-1\>请选择行政级别</option>&quot;, &quot;1&quot;, &quot;levelAdministrative&quot;)">

                                        <#if ((organizationEdit.levelAdministrative!'')??) && ((organizationEdit.levelAdministrative!'') == '')>
                                            <option class="selectOpenStyle" value=\-1\>请选择行政级别</option>
                                        <#else >
                                            <option class="selectOpenStyle" value="${organizationEdit.levelAdministrative!''}">${baseInfoLevelAdministrative!''}</option>
                                        </#if>
                                    </select>
                                    <small>机构|部门的行政级别。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">创建者|创始人|首任领导</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="${organizationEdit.createBy!''}" id="createBy" name="createBy" placeholder="请填写创建者|创始人|首任领导">
                                    <small>机构|部门的创建者|创始人|首任领导 名字。</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">备注</label>
                                <div class="am-u-sm-9">
                                        <textarea rows="3" class="tpl-form-input" cols="20" id="remark" name="remark" placeholder="备注信息">${organizationEdit.remark!''}</textarea>
                                    <small>机构|部门的备注信息。</small>
                                </div>
                            </div>

                            <br/>
                            <div class="am-form-group">
                                <div style="width:100%;text-align:center" class="am-u-sm-9">

                                    <#if (operateType!'') == "1">
                                        <button onclick="addOrUpdOraganization()" type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success ">
                                            提交
                                        </button>
                                    <#elseif (operateType!'') == "2">
                                        <button onclick="addOrUpdOraganization()" type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success ">
                                            修改
                                        </button>
                                    <#elseif (operateType!'') == "3">
                                        <button onclick="addOrUpdOraganization()" type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success ">
                                            增加父机构
                                        </button>
                                    </#if>

                                    &nbsp;&nbsp;
                                    <button onclick="colsePage()" type="button" class="am-btn am-btn-success ">
                                        取消
                                    </button>
                                </div>
                            </div>
                        </form>

                    </div>


                </div>
            </div>
        </div>
    </div>


</div>








<#--JS 部分 -->
<script type="text/javascript" src="/js/common/jquery.min.js"></script>
<script type="text/javascript" src="/js/common/base.js"></script>
<#--妹子UI-->
<script type="text/javascript" src="/plugin/amaze/js/amazeui.min.js"></script>
<script type="text/javascript" src="/plugin/amaze/js/app.js"></script>
<script type="text/javascript" src="/plugin/amaze/js/theme.js"></script>
<#--layer.js，只需要引入这个，css会自动引入-->
<script type="text/javascript" src="/plugin/layer-v3.1.1/layer.js"></script>
<#--laydate.js 时间组件-->
<script type="text/javascript" src="/plugin/laydate/laydate.js"></script>


<#--自己的js-->
<script type="text/javascript" src="/js/ztree/main-org.js"></script>
<script type="text/javascript">

    //加载完上面的div就立刻绑定时间，用函数方式的第一次点击只能绑定元素
    laydate.render({
        elem: '#createDate', //指定元素
        zIndex: 99999999 //一般用于解决与其它元素的互相被遮掩的问题
        ,calendar: true //是否显示公历节日
    });

</script>



</body>


</html>
